const http = require("http");

const server = http.createServer((request, response) => {
    // 实例化URL 对象
    // let url= new URL('http://www.xxx.com/search?a=100&1=200');
    let url = new URL(request.url,'http://192.168.159');

    // 输出路径
    console.log(url.pathname);
    // 输出 keyword 查询字符串
    console.log(url.searchParams.get('keyword'));
    response.end("url new");
});

server.listen(9000, () => {
    console.log("服务已经启动....");
});
